package com.java.comprehensive.other.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.java.comprehensive.other.config.ManConfig;
import com.java.comprehensive.other.config.annotation.LogAnnontation;
import com.java.comprehensive.other.entity.req.CallbackReq;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * @program: comprehensive-service
 * @description:
 * @author: 窦绍飞
 * @create: 2021-12-02 14:11
 **/
@RestController
@LogAnnontation
@Slf4j
@RequestMapping("/demo01")
public class DemoController {

	@Autowired
	private ManConfig man;

	@PostMapping("/getVerify")
	public String getVerify() {
		return "";
	}

	/**
	 * @param params
	 * @return
	 */
	@PostMapping("/callback")
	public String callback(@RequestBody CallbackReq params) {
		log.info("receive callback req={}", params);
		// 业务逻辑处理

		return "success";
	}

	@GetMapping("/getMan")
	public Object getMan() {
		System.out.println(man);
		return JSONUtil.toJsonStr(man);
	}

	@PutMapping("/hb/puting")
	public TestRsp putTest(@RequestBody TestReq req) {
		System.out.println(req);
		TestRsp testRsp = new TestRsp();
		testRsp.setCode("Zzz");
		return testRsp;
	}
}
